package com.hdu.dwh.service;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Set;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hdu.dwh.dtos.PageRequestDto;
import com.hdu.dwh.dtos.SourceAccessDto;
import com.hdu.dwh.pojos.source_access_pojos.SourceAccess;
import com.hdu.dwh.pojos.source_access_pojos.SourceAccessDatabase;
import com.hdu.dwh.pojos.source_access_pojos.SourceAccessDetails;
import com.hdu.dwh.results.ResponseResult;

/**
 * <p>
 * 数据接入表 服务类
 * </p>
 *
 * @author bobo
 * @since 2025-04-08
 */
public interface ISourceAccessService extends IService<SourceAccess> {

    ResponseResult add(SourceAccessDto sourceAccessDto);

    ResponseResult edit(SourceAccessDto sourceAccessDto, Long id);

    ResponseResult delete(Long id);

    ResponseResult pageQuery(PageRequestDto pageRequestDto);

    SourceAccessDetails getAll_dbs_tables_columnsFromSourceAccess(SourceAccess sourceAccess) throws Exception;

    /**
     * 返回所有数据库的详细信息，包括表和列
     * @param connection
     * @return
     * @throws SQLException
     */
    Set<SourceAccessDatabase> getAllDatabaseDetails(Connection connection, String catalogName) throws SQLException;
}
